﻿using Orleans;
using Puppy.Domain.Entities;
using System.Threading.Tasks;

namespace Puppy.Actor
{
    public interface IActor<TEntity> : IGrainWithStringKey 
        where TEntity : IEntity
    {
        /// <summary>
        /// 激活事件
        /// </summary>
        /// <returns></returns>
        Task OnActivateAsync();

        Task WriteEntityAsync(TEntity entity);

        Task<TEntity> ReadEntityAsync();

        Task ClearEntityAsync();
    }
}
